<?php
/*
YHM (Your Hosting Manager) - Copyright 2010 All Rights Reserved. - YHM Group
Released under the Simplified BSD Licence.

Website: http://yhm.co.uk
Licence: http://yhm.co.uk/about/#licence

file: install/index.php
author: Kieran D. (Polarbear541)
*/

function error($message)
{
	echo "<div id='error'><p><em>Error: $message</em></p></div><br />";
}

function random_str($length)
{
	$chars="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ1234567890";
	$len=strlen($chars);
	$i=1;
	
	while ($i <= $length)
	{
		$rand=rand(1,$len);
		$str.=$chars[$rand-1];
		$i++;
	}
	
	return $str;
}

function sql_connect()
{
	include('../includes/config.php');
	mysql_connect("$db_host", "$db_user", "$db_pass")or error("Cannot connect to host");
	mysql_select_db("$db_name")or error("Cannot connect to DB");
	define("TABLE_PREFIX", $prefix);
}
?>